Skip to content

fix(cli): enable clap help and usage features#156

Merged
JanZachmann merged 1 commit intoomnect:mainfrom
JanZachmann:chore
Apr 14, 2026
Merged

fix(cli): enable clap help and usage features#156
JanZachmann merged 1 commit intoomnect:mainfrom
JanZachmann:chore

Conversation

@JanZachmann
Copy link
Copy Markdown
Contributor

@JanZachmann JanZachmann commented Apr 14, 2026

Summary

  • clap was configured with default-features = false and only ["derive", "std"], which excluded the help feature — causing --help/-h to fail with error: unexpected argument found at every subcommand level
  • Added "help" and "usage" clap features to restore flag support and usage synopsis
  • Added 5 regression tests covering --help at root, subcommand group, and leaf levels, plus -h short form and --version

clap was configured with default-features=false and only "derive" +
"std", which excluded the "help" feature. This caused --help/-h to
fail with "unexpected argument found" at every subcommand level.

Add "help" and "usage" features to restore --help/-h support and
usage synopsis in help output. Add regression tests covering help
at root, subcommand group, and leaf command levels.

Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores standard clap-provided --help/-h and usage/version output for the omnect-cli binary by enabling the required clap features, and adds integration tests to prevent regressions.

Changes:

  • Enable clap’s help and usage features (while keeping default-features = false) so --help/-h and usage synopsis work across command levels.
  • Add integration tests covering help output at root, subcommand-group, and leaf-command levels, plus -h and --version.
  • Bump crate version from 0.28.0 to 0.28.1.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
Cargo.toml Enables clap help/usage features; adds predicates dev-dependency; bumps version.
tests/integration_tests.rs Adds regression tests validating --help/-h and --version behavior/output.
Cargo.lock Lockfile updates reflecting version bump and new predicates-related packages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JanZachmann JanZachmann merged commit a2e9167 into omnect:main Apr 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants